import { useDispatch, useSelector } from 'react-redux';
import './index.css'
import { Form, Input} from 'antd-mobile';
import { useEffect } from 'react';
import { getBilltype } from '../../store/modules/bookicon'
function Inbook() {

    const dispatch = useDispatch()
    const token = useSelector(state => state.user.token)
    const billtype = useSelector(state => state.billtype.billtype)
    useEffect(() => {
        dispatch(getBilltype(token))
    }, [])
    
    return (
        <div>
            <Form layout='horizontal'>
                <Form.Item label='金额' name='username'>
                    <Input placeholder='输入今日收获吧' clearable />
                </Form.Item>
                
            </Form>
            {billtype?.map((item, index) => {
                if (item.flow === 'income') {
                    return (
                        <div dangerouslySetInnerHTML={{__html:item.icon.replace('<svg', '<svg width="20px" height="20px"')}}></div>
                    )
                }
                
            })}
        </div>
    )
}
export default Inbook